<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>百度换肤</title>
    <style>
        body {
            background: url(image/6-6-1.jfif) no-repeat center top;
            background-size: 100%;
        }

        ul {
            position: absolute;
            top: 50%;
            left: 20%;
        }

        li {
            float: left;
            border: 2px solid white;
            list-style: none;
        }

        img {
            width: 200px;
            height: 100px;
        }
    </style>
    <script>
        window.onload = function () {
            var imgs = document.querySelector('ul').querySelectorAll('img')
            for (var i = 0; i <= imgs.length; i++) {
                imgs[i].onclick = function () {
                    document.body.style.backgroundImage = 'url(' + this.src + ')'
                }
            }
        }
    </script>
</head>

<body>
    <ul>
        <li><img src="image/6-6-1.jfif"></li>
        <li><img src="image/6-6-2.jpg"></li>
        <li><img src="image/6-6-3.jfif"></li>
        <li><img src="image/6-6-4.jfif"></li>
    </ul>
</body>

</html>